In [10]:
import plotly
plotly.offline.init_notebook_mode()
import cufflinks as cf
cf.go_offline()
cf.set_config_file(theme='pearl')
from plotly.graph_objs import Bar,Layout, Figure,Data,Scattermapbox,Marker,Scatter,Box,Histogram
In [2]:
import pandas as pd
import numpy as np

Histogram

In [4]:
N = 500
x = np.linspace(0, 1, N)
y = np.random.randn(N)
df = pd.DataFrame({'x': x, 'y': y})
In [5]:
df.head()
Out[5]:
x y
0 0.000000 2.248248
1 0.002004 -0.890605
2 0.004008 0.961558
3 0.006012 1.224779
4 0.008016 -1.349544
In [6]:
data = [Histogram(y=df['y'])]
In [7]:
plotly.offline.iplot(Figure(data=data))
In [8]:
df = pd.DataFrame({'a': np.random.randn(1000) + 1,
                   'b': np.random.randn(1000),
                   'c': np.random.randn(1000) - 1})
In [11]:
df.iplot(kind='hist')
In [18]:
cf.set_config_file(theme='ggplot')
df.iplot(kind='hist',colors=['orange','blue','seagreen'])
In [20]:
df.iplot(kind='histogram', subplots=True, shape=(3, 1),colors=['orange','blue','seagreen'])
In [21]:
df.iplot(kind='histogram', barmode='stack', bins=100, histnorm='probability',colors=['orange','blue','seagreen'])